home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / include / RCS / quad.h,v < prev    next >
Encoding:
Text File  |  1991-03-18  |  2.2 KB  |  96 lines

  1. head     1.1;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.1
  10. date     91.03.17.22.38.11;  author kupfer;  state Exp;
  11. branches ;
  12. next     ;
  13.  
  14.  
  15. desc
  16. @Operations on 64-bit integers.
  17. @
  18.  
  19.  
  20.  
  21. 1.1
  22. log
  23. @Initial revision
  24. @
  25. text
  26. @/*
  27.  * quad.h --
  28.  *
  29.  *    Operations on 64-bit integers.
  30.  *
  31.  * Copyright 1991 Regents of the University of California
  32.  * Permission to use, copy, modify, and distribute this
  33.  * software and its documentation for any purpose and without
  34.  * fee is hereby granted, provided that this copyright
  35.  * notice appears in all copies.  The University of California
  36.  * makes no representations about the suitability of this
  37.  * software for any purpose.  It is provided "as is" without
  38.  * express or implied warranty.
  39.  *
  40.  * $Header: /sprite/lib/forms/RCS/proto.h,v 1.7 91/02/09 13:24:52 ouster Exp $ SPRITE (Berkeley)
  41.  */
  42.  
  43. #ifndef _QUAD
  44. #define _QUAD
  45.  
  46. #include <stdio.h>
  47. #include <sys/types.h>
  48.  
  49. /* 
  50.  * For the sake of compatibility, use the BSD definition of the 
  51.  * types (i.e., use an array, rather than longs named "hi" and "lo"), 
  52.  * and get them out of the standard place (types.h).
  53.  * 
  54.  * For the sake of simplicity, always treat word 0 as the least 
  55.  * significant of the pair (though it might be better to pay attention 
  56.  * to the byte order of the machine).
  57.  */
  58.  
  59. #define QUAD_MOST_SIG    1
  60. #define QUAD_LEAST_SIG    0
  61.  
  62.  
  63. /*
  64.  *----------------------------------------------------------------------
  65.  *
  66.  * Quad_EQ --
  67.  *
  68.  *    Tell whether two quads (or unsigned quads) are equal.
  69.  *
  70.  * Results:
  71.  *    Returns non-zero if the given values are the same.
  72.  *
  73.  * Side effects:
  74.  *    None.
  75.  *
  76.  *----------------------------------------------------------------------
  77.  */
  78.  
  79. #define Quad_EQ(q1, q2) \
  80.     ((q1).val[QUAD_LEAST_SIG] == (q2).val[QUAD_LEAST_SIG] \
  81.      && (q1).val[QUAD_MOST_SIG] == (q2).val[QUAD_MOST_SIG])
  82.  
  83.  
  84.  
  85. extern void    Quad_AddUns _ARGS_ ((u_quad uq1, u_quad uq2, 
  86.                      u_quad *resultPtr));
  87. extern void    Quad_AddUnsLong _ARGS_ ((u_quad quadVal, u_long longVal,
  88.                      u_quad *resultPtr));
  89. extern int    Quad_CompareUns _ARGS_ ((_CONST u_quad *uq1,
  90.                      _CONST u_quad *uq2));
  91. extern void    Quad_PutUns _ARGS_ ((FILE *s, u_quad q));
  92. extern double    Quad_UnsToDouble _ARGS_  ((u_quad));
  93.  
  94. #endif /* _QUAD */
  95. @
  96.